﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using Common.DTO;
using Common.DTO.ihopplockDTO;
using LogicLayer;

namespace ImmoralServices
{
    [ServiceContract]
    public interface IGameService
    {
        // -----------------------------------------
        #region GameLobby

        // --- INFO ---

        [OperationContract]
        List<GameType> GetListOfAllGameTypes();

        [OperationContract]
        List<PlayerActiveGame_Init> GetListOfPlayersActiveGamesByGameType_Init(int playerAskingId, int gameTypeId);

        [OperationContract]
        List<PlayerActiveGame_Init> GetListOfPlayersActiveGamesByGameType_Poll(int playerAskingId, int gameTypeId);

        [OperationContract]
        List<JoinableGame> GetListOfJoinableGames(int gameTypeId, int playerAskingId);

        [OperationContract]
        List<GameNotStarted> GetListOfGamesNotStarted(int playerAskingId);


        // --- ACTIONS ---

        [OperationContract]
        GameLobby CreateGame(int playerId, int gameTypeId, int rounds);

        [OperationContract]
        bool DeleteGame(int gameId);

        [OperationContract]
        bool UpdateGameSettings(int gameId, int gameTypeId, int rounds);

        [OperationContract]
        bool JoinGame(int gameId, int playerId);

        [OperationContract]
        bool JoinRandomGame(int playerId, int gameTypeId);

        [OperationContract]
        bool LeaveGame(int gameId, int playerId);

        #endregion

        // -----------------------------------------
        #region InGame

        // --- INFO ---

        [OperationContract]
        bool HasOpponentMadeChoice(int gameId, int playerAskingId);

        [OperationContract]
        ActiveGameInfo_Init GetActiveGameInfo_Init(int gameId, int playerAskingId);

        [OperationContract]
        ActiveGameInfo_Poll GetActiveGameInfo_Poll(int gameId, int playerAskingId);


        // --- ACTION ---

        [OperationContract]
        bool MakePlayerChoice(int gameId, int playerChoosingId, int playerChoice);

        #endregion



        #region ADMIN

        // FUTURE: Lägg till metoder som returnerar intressant data för en admin
        // anropet ska bara kunna göras av en speciell användare/användartyp

        [OperationContract]
        List<Game> x_GetAllActiveGames();

        #endregion

















        //[OperationContract]
        //bool CheckOpponentStatus_dummy(int playerId, int gameId);

        //[OperationContract]
        //GameInfo CheckIfGameRoundIsFinished_dummy(int gameId);

        //[OperationContract]
        //Player GetGameWinner(int gameId);

        //[OperationContract]
        //bool UpdateGameRounds(int gameId, int rounds);

        

        

        //[OperationContract]
        //List<PlayerChoice> GetPlayersChoice(int gameId);
        
        

        

        

#if DEBUG

        [OperationContract] // Oskars testmetod
        void TestOskar();

#endif

    }
}
